package cn.wx.jove.core.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.wx.common.persistence.base.BaseController;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.jove.core.entity.Stockdata;
import cn.wx.jove.core.entity.qo.StockdataQ;
import cn.wx.jove.core.service.StockdataService;
/**
 *   @description : Stockdata 控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-11-29
 */
@RestController
@RequestMapping("/stockdata")
public class StockdataController extends BaseController {

    @Autowired
    private StockdataService stockdataService;

    /**
     * @description : 通过条件获取Stockdata
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-29
     */
    @RequestMapping(value = "/query/unique")
    public ResponseData queryUnique(StockdataQ stockdataQ) throws Exception {
        return success(stockdataService.queryUnique(stockdataQ,Stockdata.class));
    }

    /**
     * @description : 通过条件获取Stockdata分页
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-29
     */
    @RequestMapping(value = "/query/page")
    public ResponseData queryPage(StockdataQ stockdataQ) throws Exception {
        return success(stockdataService.queryPage(stockdataQ));
    }

	/**
     * @description : 通过条件获取Stockdata
     * ---------------------------------
     * @author : 
     * @since : Create in 2018-11-29
     */
    @RequestMapping(value = "/query/list")
    public ResponseData queryList(StockdataQ stockdataQ) throws Exception {
        return success(stockdataService.queryList(stockdataQ));
    }
    
    /**
     * @description : 通过id删除Stockdata
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-29
     */
//    @RequestMapping(value = "/remove", method = RequestMethod.POST)
//    public ResponseData remove(Stockdata stockdata) throws Exception {
//        return success(stockdataService.remove(stockdata));
//    }

    /**
     * @description : 通过id更新Stockdata
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-29
     */
    @RequestMapping(value = "/modify")
    public ResponseData modify(Stockdata stockdata) throws Exception {
        return success(stockdataService.modify(stockdata));
    }
    
    /**
     * @description : 新增Stockdata
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-29
     */
     @RequestMapping(value = "/create")
     public ResponseData create(Stockdata stockdata) throws Exception {
        return success(stockdataService.create(stockdata));
     }
    
     /**
      * @description : 查询最大nid数据
      * ---------------------------------
      * @author :  
      * @since : Create in 2018-11-29
      */
     @RequestMapping(value = "/queryMax")
     public ResponseData queryMax() throws Exception {
        return success(stockdataService.queryMax());
     }
}